<template>
	<view class="webview-page">
		<web-view v-if="url" :src="url"></web-view>
		<view v-else class="empty">
			<text>无效的链接</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'WebviewPage',
		data() {
			return { url: '' };
		},
		onLoad(query) {
			try {
				const raw = (query && query.url) ? decodeURIComponent(query.url) : '';
				this.url = raw;
			} catch (e) {
				this.url = '';
			}
		}
	};
</script>

<style scoped lang="less">
	.webview-page { width: 100%; height: 100vh; }
	.empty { height: 100vh; display: flex; align-items: center; justify-content: center; color: #888; }
</style>


